/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.psi.action.supplychainmana;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.psi.mapper.supplychainmana.StorageMapper;
public class StorageAction extends BaseAction
{
    @Autowired(required=false)
	private StorageMapper mapper;
    /**
    产品入库
    */
    
    public Map storageList() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        Object contact_name =mapper.contact_name(params);
        result.put("contact_name", contact_name);
        
        
        Object getdate =mapper.getdate(params);
        result.put("getdate", getdate);
        
        
        result.put("t_code", create_code(17,"bar"));
        
        
        SQLList<SQLMap> s_inout=mapper.s_inout(params);
        result.put("s_inout", s_inout);
        
        
        SQLList<SQLMap> s_firm=mapper.s_firm(params);
        result.put("s_firm", s_firm);
        
        
        SQLList<SQLMap> s_layout_item=mapper.s_layout_item(params);
        result.put("s_layout_item", s_layout_item);
        
        
        SQLList<SQLMap> s_type=mapper.s_type(params);
        result.put("s_type", s_type);
        
        
        SQLList<SQLMap> s_staff=mapper.s_staff(params);
        result.put("s_staff", s_staff);
        
        
        SQLList<SQLMap> s_top=mapper.s_top(params);
        result.put("s_top", s_top);
        
        
        SQLList<SQLMap> s_empty=mapper.s_empty(params);
        result.put("s_empty", s_empty);
        
        return result;
    }
    /**
    入库查询
    */
    
    public Map storageRecord() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        result.put("s_search", pagination.getSearchParas());
        
        
        SQLList<SQLMap> s_firm=mapper.s_firm(params);
        result.put("s_firm", s_firm);
        
        
        params.def("firm_id",-1);
        SQLList<SQLMap> s_layout_item=mapper.s_layout_item(params);
        result.put("s_layout_item", s_layout_item);
        
        
        
        
        SQLList<SQLMap> s_record=mapper.s_record(params,pagination);
        s_record.setPagedListInfo(pagination);
        result.put("s_record", s_record);
        
        return result;
    }
    /**
    入库查看详情
    */
    
    public Map storageDetil() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_stock=mapper.t_stock(params);
        SQLMap t_stock_emt=t_stock.getExistfirst();
        result.put("t_stock", t_stock_emt);
        
        
        SQLList<SQLMap> s_goods=mapper.s_goods(params);
        result.put("s_goods", s_goods);
        
        return result;
    }
    /**
    操作人选择
    */
    
    public Map staffChoice() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_staff=mapper.s_staff(params);
        result.put("s_staff", s_staff);
        
        return result;
    }
    /**
    仓库选择
    */
    
    public Map warehouseChoice() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        result.put("s_search", pagination.getSearchParas());
        
        
        SQLList<SQLMap> s_hours=mapper.s_hours(params,pagination);
        s_hours.setPagedListInfo(pagination);
        result.put("s_hours", s_hours);
        
        return result;
    }
    /**
    供应商选择
    */
    
    public Map supplierChoice() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_tockset=mapper.s_tockset(params);
        result.put("s_tockset", s_tockset);
        
        
        result.put("s_search", pagination.getSearchParas());
        
        
        SQLList<SQLMap> p_message=mapper.p_message(params,pagination);
        p_message.setPagedListInfo(pagination);
        result.put("p_message", p_message);
        
        return result;
    }
    /**
    供应商信息
    */
    
    public Map supplierDetil() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> message=mapper.message(params);
        SQLMap message_emt=message.getExistfirst();
        result.put("message", message_emt);
        
        return result;
    }
    /**
    供应商明细公用页
    */
    
    public Map supplierPubDet() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> phones=mapper.phones(params);
        result.put("phones", phones);
        
        
        SQLList<SQLMap> address=mapper.address(params);
        SQLMap address_emt=address.getExistfirst();
        result.put("address", address_emt);
        
        
        SQLList<SQLMap> email=mapper.email(params);
        result.put("email", email);
        
        
        SQLList<SQLMap> moment_info=mapper.moment_info(params);
        result.put("moment_info", moment_info);
        
        
        SQLList<SQLMap> baidumap=mapper.baidumap(params);
        result.put("baidumap", baidumap);
        
        return result;
    }
    /**
    产品选择
    */
    
    public Map productChoice() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        tb = createTreeBean("l_class_treecols");
        tb.setPrefix("img");
        tb.setPid(1);
        SQLList<SQLMap> l_class=mapper.l_class(params);
        l_class = l_class.buildTree(tb,tb.getPid());
        result.put("l_class", l_class);
        
        
        SQLList<SQLMap> s_produce_series=mapper.s_produce_series(params);
        result.put("s_produce_series", s_produce_series);
        
        
        result.put("s_search", pagination.getSearchParas());
        
        
        SQLList<SQLMap> produce=mapper.produce(params,pagination);
        produce.setPagedListInfo(pagination);
        result.put("produce", produce);
        
        return result;
    }
    /**
    产品入库修改
    */
    
    public Map storageListSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int stock_id = mapper.stock_id(params);
        result.put("stock_id", stock_id);
        
        
        for (SQLMap emt:hqlBean.getTableElements("")){
            params=new SQLParam(request,emt.getMap());
            mapper.record_id(params);
        }
        
        
        Object goods_insert =
        mapper.goods_insert(params);
        result.put("goods_insert", goods_insert);
        
        
        for (SQLMap emt:hqlBean.getTableElements("")){
            params=new SQLParam(request,emt.getMap());
            mapper.goods_id(params);
        }
        
        
        for (SQLMap emt:hqlBean.getTableElements("")){
            params=new SQLParam(request,emt.getMap());
            mapper.product_id(params);
        }
        
        return result;
    }
    /**
    */
    
    public Map d_record() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_record(params);
        
        return result;
    }
    public Map ajaxList(){
        String sql="";
        String pagesql="";
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        if(request.getParameter("cfield_name").contains("district_rack")){
            SQLList<SQLMap> district_rack=mapper.district_rack(params);
            district_rack.setSelectNone("格号");
            result.put("district_rack", district_rack);
        }
        
        
        if(request.getParameter("cfield_name").contains("district_line")){
            SQLList<SQLMap> district_line=mapper.district_line(params);
            district_line.setSelectNone("排号");
            result.put("district_line", district_line);
        }
        
        
        if(request.getParameter("cfield_name").contains("district_row")){
            SQLList<SQLMap> district_row=mapper.district_row(params);
            district_row.setSelectNone("行号");
            result.put("district_row", district_row);
        }
        
        
        if(request.getParameter("cfield_name").contains("staff_id")){
            SQLList<SQLMap> staff_id=mapper.staff_id(params);
            result.put("staff_id", staff_id);
        }
        
        return result;
    }
    public Map ajaxRecord(){
        String sql="";
        String pagesql="";
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        if(request.getParameter("cfield_name").contains("layout_item_id")){
            SQLList<SQLMap> layout_item_id=mapper.layout_item_id(params);
            result.put("layout_item_id", layout_item_id);
        }
        
        return result;
    }
}